<template>
	<f-popup ref="popup" position="bottom">
		<view class="content">
			<view class="head-title">产品参数</view>
			<view class="product">
				<view class="img">
					<image :src="info.thumb" mode="aspectFill"></image>
				</view>
				<view class="title">{{ info.title }}</view>
			</view>
			<scroll-view scroll-y class="scroll">
				<view class="lists">
					<view class="item" v-for="(item, index) in info.params_data" :key="index">
						<view class="padding-r40">{{ item.title }}</view>
						<view>x{{ item.num }}</view>
					</view>
				</view>
			</scroll-view>
			
			<view class="footer-btns">
				<button class="confirm-btn flex-1" @click="close">完成</button>
			</view>
		</view>
	</f-popup>
</template>

<script>
	export default {
		data() {
			return {
				info: {}
			};
		},
		onReady() {
			
		},
		methods: {
			open(info) {
				this.info = info
				this.$refs.popup.open();
			},
			close() {
				this.$refs.popup.close();
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		width: 100%;
		background-color: #FFFFFF;
		border-top-left-radius: 26rpx;
		border-top-right-radius: 26rpx;
	}
	
	.head-title {
		font-size: 34rpx;
		font-weight: 600;
		line-height: 46rpx;
		text-align: center;
		color: #000000;
		padding: 32rpx;
	}
	
	.product {
		display: flex;
		padding: 0 40rpx;
		align-items: center;
		box-sizing: border-box;
		padding-bottom: 32rpx;
		
		.img {
			width: 92rpx;
			height: 92rpx;
			margin-right: 20rpx;
			border-radius: 50%;
			overflow: hidden;
			
			image {
				width: 100%;
				height: 100%;
			}
		}
		
		.title {
			font-size: 32rpx;
			font-weight: 500;
			line-height: 46rpx;
			color: #000000;
		}
	}
	
	.scroll {
		width: 100%;
		height: 50vh;
		box-sizing: border-box;
		padding: 0 40rpx;
		
		.lists {
			display: flex;
			flex-direction: column;
			gap: 24rpx;
			
			.item {
				position: relative;
				display: flex;
				padding-left: 24rpx;
				align-items: center;
				justify-content: space-between;
			
				&::after {
					position: absolute;
					content: '';
					left: 0;
					width: 10rpx;
					height: 10rpx;
					border-radius: 999px;
					background-color: #000000;
				}
			
				font-size: 28rpx;
				font-weight: 500;
				line-height: 46rpx;
				color: #000000;
			}
			
			.icon {
				width: 32rpx;
				height: 32rpx;
				margin-right: 16rpx;
				vertical-align: bottom;
				
				image {
					width: 100%;
					height: 100%;
				}
			}
			
			.title {
				font-size: 28rpx;
				font-weight: 500;
				line-height: 46rpx;
				color: #000000;
			}
			
			.desc {
				color: #666666;
				font-size: 24rpx;
				font-weight: 400;
				line-height: 34rpx;
				padding-top: 12rpx;
			}
		}
	}
	
	.footer-btns {
		// position: fixed;
		// left: 0;
		// right: 0;
		// bottom: 0;
		width: 100%;
		// z-index: 999;
		padding: 20rpx 32rpx;
		box-sizing: border-box;
		background-color: #FFFFFF;
		box-shadow: 0px 0px 33rpx rgba(0, 0, 0, 0.05);
		padding-bottom: calc(20rpx + constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
		padding-bottom: calc(20rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
		
		display: flex;
		align-items: center;
		gap: 80rpx;
	}
</style>
